home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / CMApplication.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  50.8 KB  |  1,497 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        CMApplication.h
  3.  
  4.      Contains:    Color Matching Interfaces
  5.  
  6.      Version:    Technology:    ColorSync 3.0
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1992, 1994-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMAPPLICATION__
  18. #define __CMAPPLICATION__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __QUICKDRAW__
  25.     #include <Quickdraw.h>
  26. #endif
  27.  
  28. #ifndef __FILES__
  29.     #include <Files.h>
  30. #endif
  31.  
  32. #ifndef __CMICCPROFILE__
  33.     #include <CMICCProfile.h>
  34. #endif
  35.  
  36. #ifndef __DISPLAYS__
  37.     #include <Displays.h>
  38. #endif
  39.  
  40. #ifndef __MACERRORS__
  41.     #include <MacErrors.h>
  42. #endif
  43.  
  44. #if TARGET_API_MAC_OS8
  45. #ifndef __PRINTING__
  46.     #include <Printing.h>
  47. #endif
  48.  
  49. #endif  /* TARGET_API_MAC_OS8 */
  50.  
  51.  
  52. #if TARGET_OS_WIN32
  53. #include <windows.h>
  54. #endif
  55.  
  56.  
  57.  
  58. #if PRAGMA_ONCE
  59. #pragma once
  60. #endif
  61.  
  62. #ifdef __cplusplus
  63. extern "C" {
  64. #endif
  65.  
  66. #if PRAGMA_IMPORT
  67. #pragma import on
  68. #endif
  69.  
  70. #if PRAGMA_STRUCT_ALIGN
  71.     #pragma options align=mac68k
  72. #elif PRAGMA_STRUCT_PACKPUSH
  73.     #pragma pack(push, 2)
  74. #elif PRAGMA_STRUCT_PACK
  75.     #pragma pack(2)
  76. #endif
  77.  
  78. enum {
  79.     kDefaultCMMSignature        = FOUR_CHAR_CODE('appl')
  80. };
  81.  
  82. /* Macintosh 68K trap word */
  83. enum {
  84.     cmTrap                        = 0xABEE
  85. };
  86.  
  87.  
  88. /* PicComment IDs */
  89. enum {
  90.     cmBeginProfile                = 220,
  91.     cmEndProfile                = 221,
  92.     cmEnableMatching            = 222,
  93.     cmDisableMatching            = 223,
  94.     cmComment                    = 224
  95. };
  96.  
  97. /* PicComment selectors for cmComment */
  98. enum {
  99.     cmBeginProfileSel            = 0,
  100.     cmContinueProfileSel        = 1,
  101.     cmEndProfileSel                = 2,
  102.     cmProfileIdentifierSel        = 3
  103. };
  104.  
  105.  
  106. /* Defines for version 1.0 CMProfileSearchRecord.fieldMask */
  107. enum {
  108.     cmMatchCMMType                = 0x00000001,
  109.     cmMatchApplProfileVersion    = 0x00000002,
  110.     cmMatchDataType                = 0x00000004,
  111.     cmMatchDeviceType            = 0x00000008,
  112.     cmMatchDeviceManufacturer    = 0x00000010,
  113.     cmMatchDeviceModel            = 0x00000020,
  114.     cmMatchDeviceAttributes        = 0x00000040,
  115.     cmMatchFlags                = 0x00000080,
  116.     cmMatchOptions                = 0x00000100,
  117.     cmMatchWhite                = 0x00000200,
  118.     cmMatchBlack                = 0x00000400
  119. };
  120.  
  121. /* Defines for version 2.0 CMSearchRecord.searchMask */
  122. enum {
  123.     cmMatchAnyProfile            = 0x00000000,
  124.     cmMatchProfileCMMType        = 0x00000001,
  125.     cmMatchProfileClass            = 0x00000002,
  126.     cmMatchDataColorSpace        = 0x00000004,
  127.     cmMatchProfileConnectionSpace = 0x00000008,
  128.     cmMatchManufacturer            = 0x00000010,
  129.     cmMatchModel                = 0x00000020,
  130.     cmMatchAttributes            = 0x00000040,
  131.     cmMatchProfileFlags            = 0x00000080
  132. };
  133.  
  134.  
  135. /* deviceType values for ColorSync 1.0 Device Profile access */
  136. enum {
  137.     cmSystemDevice                = FOUR_CHAR_CODE('sys '),
  138.     cmGDevice                    = FOUR_CHAR_CODE('gdev')
  139. };
  140.  
  141. /* Commands for CMFlattenUPP(...) */
  142. enum {
  143.     cmOpenReadSpool                = 1,
  144.     cmOpenWriteSpool            = 2,
  145.     cmReadSpool                    = 3,
  146.     cmWriteSpool                = 4,
  147.     cmCloseSpool                = 5
  148. };
  149.  
  150. /* Flags for PostScript-related functions */
  151. enum {
  152.     cmPS7bit                    = 1,
  153.     cmPS8bit                    = 2
  154. };
  155.  
  156. /* Flags for profile embedding functions */
  157. enum {
  158.     cmEmbedWholeProfile            = 0x00000000,
  159.     cmEmbedProfileIdentifier    = 0x00000001
  160. };
  161.  
  162. /* Commands for CMAccessUPP(...) */
  163. enum {
  164.     cmOpenReadAccess            = 1,
  165.     cmOpenWriteAccess            = 2,
  166.     cmReadAccess                = 3,
  167.     cmWriteAccess                = 4,
  168.     cmCloseAccess                = 5,
  169.     cmCreateNewAccess            = 6,
  170.     cmAbortWriteAccess            = 7,
  171.     cmBeginAccess                = 8,
  172.     cmEndAccess                    = 9
  173. };
  174.  
  175.  
  176. /* Abstract data type for memory-based Profile */
  177. typedef struct OpaqueCMProfileRef*         CMProfileRef;
  178. /* Abstract data type for Profile search result */
  179. typedef struct OpaqueCMProfileSearchRef*  CMProfileSearchRef;
  180. /* Abstract data type for BeginMatching(...) reference */
  181. typedef struct OpaqueCMMatchRef*         CMMatchRef;
  182. /* Abstract data type for ColorWorld reference */
  183. typedef struct OpaqueCMWorldRef*         CMWorldRef;
  184. /* Caller-supplied flatten function */
  185. typedef CALLBACK_API( OSErr , CMFlattenProcPtr )(long command, long *size, void *data, void *refCon);
  186. /* Caller-supplied progress function for Bitmap & PixMap matching routines */
  187. typedef CALLBACK_API( Boolean , CMBitmapCallBackProcPtr )(long progress, void *refCon);
  188. /* Caller-supplied progress function for NCMMConcatInit & NCMMNewLinkProfile routines */
  189. typedef CALLBACK_API( Boolean , CMConcatCallBackProcPtr )(long progress, void *refCon);
  190. /* Caller-supplied filter function for Profile search */
  191. typedef CALLBACK_API( Boolean , CMProfileFilterProcPtr )(CMProfileRef prof, void *refCon);
  192. /* Caller-supplied function for profile access */
  193. typedef CALLBACK_API( OSErr , CMProfileAccessProcPtr )(long command, long offset, long *size, void *data, void *refCon);
  194. typedef STACK_UPP_TYPE(CMFlattenProcPtr)                         CMFlattenUPP;
  195. typedef STACK_UPP_TYPE(CMBitmapCallBackProcPtr)                 CMBitmapCallBackUPP;
  196. typedef STACK_UPP_TYPE(CMConcatCallBackProcPtr)                 CMConcatCallBackUPP;
  197. typedef STACK_UPP_TYPE(CMProfileFilterProcPtr)                     CMProfileFilterUPP;
  198. typedef STACK_UPP_TYPE(CMProfileAccessProcPtr)                     CMProfileAccessUPP;
  199. #if OPAQUE_UPP_TYPES
  200.     EXTERN_API(CMFlattenUPP)
  201.     NewCMFlattenUPP                   (CMFlattenProcPtr        userRoutine);
  202.  
  203.     EXTERN_API(CMBitmapCallBackUPP)
  204.     NewCMBitmapCallBackUPP           (CMBitmapCallBackProcPtr    userRoutine);
  205.  
  206.     EXTERN_API(CMConcatCallBackUPP)
  207.     NewCMConcatCallBackUPP           (CMConcatCallBackProcPtr    userRoutine);
  208.  
  209.     EXTERN_API(CMProfileFilterUPP)
  210.     NewCMProfileFilterUPP           (CMProfileFilterProcPtr    userRoutine);
  211.  
  212.     EXTERN_API(CMProfileAccessUPP)
  213.     NewCMProfileAccessUPP           (CMProfileAccessProcPtr    userRoutine);
  214.  
  215.     EXTERN_API(void)
  216.     DisposeCMFlattenUPP               (CMFlattenUPP            userUPP);
  217.  
  218.     EXTERN_API(void)
  219.     DisposeCMBitmapCallBackUPP       (CMBitmapCallBackUPP        userUPP);
  220.  
  221.     EXTERN_API(void)
  222.     DisposeCMConcatCallBackUPP       (CMConcatCallBackUPP        userUPP);
  223.  
  224.     EXTERN_API(void)
  225.     DisposeCMProfileFilterUPP       (CMProfileFilterUPP        userUPP);
  226.  
  227.     EXTERN_API(void)
  228.     DisposeCMProfileAccessUPP       (CMProfileAccessUPP        userUPP);
  229.  
  230.     EXTERN_API(OSErr)
  231.     InvokeCMFlattenUPP               (long                    command,
  232.                                     long *                    size,
  233.                                     void *                    data,
  234.                                     void *                    refCon,
  235.                                     CMFlattenUPP            userUPP);
  236.  
  237.     EXTERN_API(Boolean)
  238.     InvokeCMBitmapCallBackUPP       (long                    progress,
  239.                                     void *                    refCon,
  240.                                     CMBitmapCallBackUPP        userUPP);
  241.  
  242.     EXTERN_API(Boolean)
  243.     InvokeCMConcatCallBackUPP       (long                    progress,
  244.                                     void *                    refCon,
  245.                                     CMConcatCallBackUPP        userUPP);
  246.  
  247.     EXTERN_API(Boolean)
  248.     InvokeCMProfileFilterUPP       (CMProfileRef            prof,
  249.                                     void *                    refCon,
  250.                                     CMProfileFilterUPP        userUPP);
  251.  
  252.     EXTERN_API(OSErr)
  253.     InvokeCMProfileAccessUPP       (long                    command,
  254.                                     long                    offset,
  255.                                     long *                    size,
  256.                                     void *                    data,
  257.                                     void *                    refCon,
  258.                                     CMProfileAccessUPP        userUPP);
  259.  
  260. #else
  261.     enum { uppCMFlattenProcInfo = 0x00003FE0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  262.     enum { uppCMBitmapCallBackProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  263.     enum { uppCMConcatCallBackProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  264.     enum { uppCMProfileFilterProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  265.     enum { uppCMProfileAccessProcInfo = 0x0000FFE0 };                 /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  266.     #define NewCMFlattenUPP(userRoutine)                             (CMFlattenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMFlattenProcInfo, GetCurrentArchitecture())
  267.     #define NewCMBitmapCallBackUPP(userRoutine)                     (CMBitmapCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMBitmapCallBackProcInfo, GetCurrentArchitecture())
  268.     #define NewCMConcatCallBackUPP(userRoutine)                     (CMConcatCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMConcatCallBackProcInfo, GetCurrentArchitecture())
  269.     #define NewCMProfileFilterUPP(userRoutine)                         (CMProfileFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileFilterProcInfo, GetCurrentArchitecture())
  270.     #define NewCMProfileAccessUPP(userRoutine)                         (CMProfileAccessUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileAccessProcInfo, GetCurrentArchitecture())
  271.     #define DisposeCMFlattenUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  272.     #define DisposeCMBitmapCallBackUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  273.     #define DisposeCMConcatCallBackUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  274.     #define DisposeCMProfileFilterUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  275.     #define DisposeCMProfileAccessUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  276.     #define InvokeCMFlattenUPP(command, size, data, refCon, userUPP)  (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppCMFlattenProcInfo, (command), (size), (data), (refCon))
  277.     #define InvokeCMBitmapCallBackUPP(progress, refCon, userUPP)     (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCMBitmapCallBackProcInfo, (progress), (refCon))
  278.     #define InvokeCMConcatCallBackUPP(progress, refCon, userUPP)     (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCMConcatCallBackProcInfo, (progress), (refCon))
  279.     #define InvokeCMProfileFilterUPP(prof, refCon, userUPP)         (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCMProfileFilterProcInfo, (prof), (refCon))
  280.     #define InvokeCMProfileAccessUPP(command, offset, size, data, refCon, userUPP)  (OSErr)CALL_FIVE_PARAMETER_UPP((userUPP), uppCMProfileAccessProcInfo, (command), (offset), (size), (data), (refCon))
  281. #endif
  282. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  283. #define NewCMFlattenProc(userRoutine)                             NewCMFlattenUPP(userRoutine)
  284. #define NewCMBitmapCallBackProc(userRoutine)                     NewCMBitmapCallBackUPP(userRoutine)
  285. #define NewCMConcatCallBackProc(userRoutine)                     NewCMConcatCallBackUPP(userRoutine)
  286. #define NewCMProfileFilterProc(userRoutine)                     NewCMProfileFilterUPP(userRoutine)
  287. #define NewCMProfileAccessProc(userRoutine)                     NewCMProfileAccessUPP(userRoutine)
  288. #define CallCMFlattenProc(userRoutine, command, size, data, refCon) InvokeCMFlattenUPP(command, size, data, refCon, userRoutine)
  289. #define CallCMBitmapCallBackProc(userRoutine, progress, refCon)    InvokeCMBitmapCallBackUPP(progress, refCon, userRoutine)
  290. #define CallCMConcatCallBackProc(userRoutine, progress, refCon)    InvokeCMConcatCallBackUPP(progress, refCon, userRoutine)
  291. #define CallCMProfileFilterProc(userRoutine, prof, refCon)        InvokeCMProfileFilterUPP(prof, refCon, userRoutine)
  292. #define CallCMProfileAccessProc(userRoutine, command, offset, size, data, refCon) InvokeCMProfileAccessUPP(command, offset, size, data, refCon, userRoutine)
  293. typedef long                             CMError;
  294. /* For 1.0 and 2.0 profile header variants */
  295. /* CMAppleProfileHeader */
  296.  
  297. union CMAppleProfileHeader {
  298.     CMHeader                         cm1;
  299.     CM2Header                         cm2;
  300. };
  301. typedef union CMAppleProfileHeader        CMAppleProfileHeader;
  302. /* Param for CWConcatColorWorld(...) */
  303.  
  304. struct CMConcatProfileSet {
  305.     UInt16                             keyIndex;                    /* Zero-based */
  306.     UInt16                             count;                        /* Min 1 */
  307.     CMProfileRef                     profileSet[1];                /* Variable. Ordered from Source -> Dest */
  308. };
  309. typedef struct CMConcatProfileSet        CMConcatProfileSet;
  310.  
  311. /* NCMConcatProfileSpec Tags */
  312. enum {
  313.     kNoTransform                = 0,                            /* Not used */
  314.     kUseAtoB                    = 1,                            /* Use 'A2B*' tag from this profile or equivalent */
  315.     kUseBtoA                    = 2,                            /* Use 'B2A*' tag from this profile or equivalent */
  316.     kUseBtoB                    = 3,                            /* Use 'pre*' tag from this profile or equivalent */
  317.                                                                 /* For typical device profiles the following synonyms may be useful */
  318.     kDeviceToPCS                = kUseAtoB,                        /* Device Dependent to Device Independent */
  319.     kPCSToDevice                = kUseBtoA,                        /* Device Independent to Device Dependent */
  320.     kPCSToPCS                    = kUseBtoB,                        /* Independent, through device's gamut */
  321.     kUseProfileIntent            = (long)0xFFFFFFFF                /* For renderingIntent in NCMConcatProfileSpec    */
  322. };
  323.  
  324. /* NCMConcatProfileSpec */
  325.  
  326. struct NCMConcatProfileSpec {
  327.     UInt32                             renderingIntent;            /* renderingIntent override        */
  328.     UInt32                             transformTag;                /* transformTag, defined above    */
  329.     CMProfileRef                     profile;                    /* profile */
  330. };
  331. typedef struct NCMConcatProfileSpec        NCMConcatProfileSpec;
  332. /* NCMConcatProfileSet */
  333.  
  334. struct NCMConcatProfileSet {
  335.     OSType                             cmm;                        /* e.g. 'KCMS', 'appl', ...  uniquely ids the cmm, or 0000 */
  336.     UInt32                             flags;                        /* specify quality, lookup only, no gamut checking ... */
  337.     UInt32                             flagsMask;                    /* which bits of 'flags' to use to override profile */
  338.     UInt32                             profileCount;                /* how many ProfileSpecs in the following set */
  339.     NCMConcatProfileSpec             profileSpecs[1];            /* Variable. Ordered from Source -> Dest */
  340. };
  341. typedef struct NCMConcatProfileSet        NCMConcatProfileSet;
  342. /* ColorSync color data types */
  343.  
  344. struct CMRGBColor {
  345.     UInt16                             red;                        /* 0..65535 */
  346.     UInt16                             green;
  347.     UInt16                             blue;
  348. };
  349. typedef struct CMRGBColor                CMRGBColor;
  350.  
  351. struct CMCMYKColor {
  352.     UInt16                             cyan;                        /* 0..65535 */
  353.     UInt16                             magenta;
  354.     UInt16                             yellow;
  355.     UInt16                             black;
  356. };
  357. typedef struct CMCMYKColor                CMCMYKColor;
  358.  
  359. struct CMCMYColor {
  360.     UInt16                             cyan;                        /* 0..65535 */
  361.     UInt16                             magenta;
  362.     UInt16                             yellow;
  363. };
  364. typedef struct CMCMYColor                CMCMYColor;
  365.  
  366. struct CMHLSColor {
  367.     UInt16                             hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  368.     UInt16                             lightness;                    /* 0..65535 */
  369.     UInt16                             saturation;                    /* 0..65535 */
  370. };
  371. typedef struct CMHLSColor                CMHLSColor;
  372.  
  373. struct CMHSVColor {
  374.     UInt16                             hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  375.     UInt16                             saturation;                    /* 0..65535 */
  376.     UInt16                             value;                        /* 0..65535 */
  377. };
  378. typedef struct CMHSVColor                CMHSVColor;
  379.  
  380. struct CMLabColor {
  381.     UInt16                             L;                            /* 0..65535 maps to 0..100 */
  382.     UInt16                             a;                            /* 0..65535 maps to -128..127.996 */
  383.     UInt16                             b;                            /* 0..65535 maps to -128..127.996 */
  384. };
  385. typedef struct CMLabColor                CMLabColor;
  386.  
  387. struct CMLuvColor {
  388.     UInt16                             L;                            /* 0..65535 maps to 0..100 */
  389.     UInt16                             u;                            /* 0..65535 maps to -128..127.996 */
  390.     UInt16                             v;                            /* 0..65535 maps to -128..127.996 */
  391. };
  392. typedef struct CMLuvColor                CMLuvColor;
  393.  
  394. struct CMYxyColor {
  395.     UInt16                             capY;                        /* 0..65535 maps to 0..1 */
  396.     UInt16                             x;                            /* 0..65535 maps to 0..1 */
  397.     UInt16                             y;                            /* 0..65535 maps to 0..1 */
  398. };
  399. typedef struct CMYxyColor                CMYxyColor;
  400.  
  401. struct CMGrayColor {
  402.     UInt16                             gray;                        /* 0..65535 */
  403. };
  404. typedef struct CMGrayColor                CMGrayColor;
  405.  
  406. struct CMMultichannel5Color {
  407.     UInt8                             components[5];                /* 0..255 */
  408. };
  409. typedef struct CMMultichannel5Color        CMMultichannel5Color;
  410.  
  411. struct CMMultichannel6Color {
  412.     UInt8                             components[6];                /* 0..255 */
  413. };
  414. typedef struct CMMultichannel6Color        CMMultichannel6Color;
  415.  
  416. struct CMMultichannel7Color {
  417.     UInt8                             components[7];                /* 0..255 */
  418. };
  419. typedef struct CMMultichannel7Color        CMMultichannel7Color;
  420.  
  421. struct CMMultichannel8Color {
  422.     UInt8                             components[8];                /* 0..255 */
  423. };
  424. typedef struct CMMultichannel8Color        CMMultichannel8Color;
  425.  
  426. struct CMNamedColor {
  427.     UInt32                             namedColorIndex;            /* 0..a lot */
  428. };
  429. typedef struct CMNamedColor                CMNamedColor;
  430.  
  431. union CMColor {
  432.     CMRGBColor                         rgb;
  433.     CMHSVColor                         hsv;
  434.     CMHLSColor                         hls;
  435.     CMXYZColor                         XYZ;
  436.     CMLabColor                         Lab;
  437.     CMLuvColor                         Luv;
  438.     CMYxyColor                         Yxy;
  439.     CMCMYKColor                     cmyk;
  440.     CMCMYColor                         cmy;
  441.     CMGrayColor                     gray;
  442.     CMMultichannel5Color             mc5;
  443.     CMMultichannel6Color             mc6;
  444.     CMMultichannel7Color             mc7;
  445.     CMMultichannel8Color             mc8;
  446.     CMNamedColor                     namedColor;
  447. };
  448. typedef union CMColor                    CMColor;
  449.  
  450. struct CMProfileSearchRecord {
  451.     CMHeader                         header;
  452.     UInt32                             fieldMask;
  453.     UInt32                             reserved[2];
  454. };
  455. typedef struct CMProfileSearchRecord    CMProfileSearchRecord;
  456. typedef CMProfileSearchRecord *            CMProfileSearchRecordPtr;
  457. typedef CMProfileSearchRecordPtr *        CMProfileSearchRecordHandle;
  458. /* Search definition for 2.0 */
  459.  
  460. struct CMSearchRecord {
  461.     OSType                             CMMType;
  462.     OSType                             profileClass;
  463.     OSType                             dataColorSpace;
  464.     OSType                             profileConnectionSpace;
  465.     UInt32                             deviceManufacturer;
  466.     UInt32                             deviceModel;
  467.     UInt32                             deviceAttributes[2];
  468.     UInt32                             profileFlags;
  469.     UInt32                             searchMask;
  470.     CMProfileFilterUPP                 filter;
  471. };
  472. typedef struct CMSearchRecord            CMSearchRecord;
  473. /* CMMInfo structure */
  474.  
  475. struct CMMInfo {
  476.     UInt32                             dataSize;                    /* Size of this structure - compatibility*/
  477.     OSType                             CMMType;                    /* Signature, e.g. 'KCMS'*/
  478.     OSType                             CMMMfr;                        /* Vendor, e.g. 'appl'*/
  479.     UInt32                             CMMVersion;                    /* cmm version number*/
  480.     unsigned char                     ASCIIName[32];                /* pascal string - name*/
  481.     unsigned char                     ASCIIDesc[256];                /* pascal string - description or copyright*/
  482.     UniCharCount                     UniCodeNameCount;            /* count of UniChars in following array*/
  483.     UniChar                         UniCodeName[32];            /* the name in UniCode chars*/
  484.     UniCharCount                     UniCodeDescCount;            /* count of UniChars in following array*/
  485.     UniChar                         UniCodeDesc[256];            /* the description in UniCode chars*/
  486. };
  487. typedef struct CMMInfo                    CMMInfo;
  488. /* GetCWInfo structures */
  489.  
  490. struct CMMInfoRecord {
  491.     OSType                             CMMType;
  492.     long                             CMMVersion;
  493. };
  494. typedef struct CMMInfoRecord            CMMInfoRecord;
  495.  
  496. struct CMCWInfoRecord {
  497.     UInt32                             cmmCount;
  498.     CMMInfoRecord                     cmmInfo[2];
  499. };
  500. typedef struct CMCWInfoRecord            CMCWInfoRecord;
  501. /* profile identifier structures */
  502.  
  503. struct CMProfileIdentifier {
  504.     CM2Header                         profileHeader;
  505.     CMDateTime                         calibrationDate;
  506.     UInt32                             ASCIIProfileDescriptionLen;
  507.     char                             ASCIIProfileDescription[1];    /* variable length */
  508. };
  509. typedef struct CMProfileIdentifier        CMProfileIdentifier;
  510. typedef CMProfileIdentifier *            CMProfileIdentifierPtr;
  511. /* packing formats */
  512. enum {
  513.     cmNoColorPacking            = 0x0000,
  514.     cmWord5ColorPacking            = 0x0500,
  515.     cmWord565ColorPacking        = 0x0600,
  516.     cmLong8ColorPacking            = 0x0800,
  517.     cmLong10ColorPacking        = 0x0A00,
  518.     cmAlphaFirstPacking            = 0x1000,
  519.     cmOneBitDirectPacking        = 0x0B00,
  520.     cmAlphaLastPacking            = 0x0000,
  521.     cm8_8ColorPacking            = 0x2800,
  522.     cm16_8ColorPacking            = 0x2000,
  523.     cm24_8ColorPacking            = 0x2100,
  524.     cm32_8ColorPacking            = cmLong8ColorPacking,
  525.     cm40_8ColorPacking            = 0x2200,
  526.     cm48_8ColorPacking            = 0x2300,
  527.     cm56_8ColorPacking            = 0x2400,
  528.     cm64_8ColorPacking            = 0x2500,
  529.     cm32_16ColorPacking            = 0x2600,
  530.     cm48_16ColorPacking            = 0x2900,
  531.     cm64_16ColorPacking            = 0x2A00,
  532.     cm32_32ColorPacking            = 0x2700,
  533.     cmLittleEndianPacking        = 0x4000,
  534.     cmReverseChannelPacking        = 0x8000
  535. };
  536.  
  537. /* colorspace masks */
  538. enum {
  539.     cmColorSpaceSpaceMask        = 0x0000007F,
  540.     cmColorSpaceAlphaMask        = 0x00000080,
  541.     cmColorSpaceSpaceAndAlphaMask = 0x000000FF,
  542.     cmColorSpacePackingMask        = 0x0000FF00,
  543.     cmColorSpaceReservedMask    = (long)0xFFFF0000
  544. };
  545.  
  546. /* general colorspaces */
  547. enum {
  548.     cmNoSpace                    = 0,
  549.     cmRGBSpace                    = 1,
  550.     cmCMYKSpace                    = 2,
  551.     cmHSVSpace                    = 3,
  552.     cmHLSSpace                    = 4,
  553.     cmYXYSpace                    = 5,
  554.     cmXYZSpace                    = 6,
  555.     cmLUVSpace                    = 7,
  556.     cmLABSpace                    = 8,
  557.     cmReservedSpace1            = 9,
  558.     cmGraySpace                    = 10,
  559.     cmReservedSpace2            = 11,
  560.     cmGamutResultSpace            = 12,
  561.     cmNamedIndexedSpace            = 16,
  562.     cmMCFiveSpace                = 17,
  563.     cmMCSixSpace                = 18,
  564.     cmMCSevenSpace                = 19,
  565.     cmMCEightSpace                = 20,
  566.     cmAlphaSpace                = 0x80,
  567.     cmRGBASpace                    = cmRGBSpace + cmAlphaSpace,
  568.     cmGrayASpace                = cmGraySpace + cmAlphaSpace
  569. };
  570.  
  571. /* supported CMBitmapColorSpaces - Each of the following is a */
  572. /* combination of a general colospace and a packing formats. */
  573. /* Each can also be or'd with cmReverseChannelPacking. */
  574. enum {
  575.     cmGray8Space                = cmGraySpace + cm8_8ColorPacking,
  576.     cmGrayA16Space                = cmGrayASpace + cm16_8ColorPacking,
  577.     cmGray16Space                = cmGraySpace,
  578.     cmGrayA32Space                = cmGrayASpace,
  579.     cmGray16LSpace                = cmGraySpace + cmLittleEndianPacking,
  580.     cmGrayA32LSpace                = cmGrayASpace + cmLittleEndianPacking,
  581.     cmRGB16Space                = cmRGBSpace + cmWord5ColorPacking,
  582.     cmRGB16LSpace                = cmRGBSpace + cmWord5ColorPacking + cmLittleEndianPacking,
  583.     cmRGB565Space                = cmRGBSpace + cmWord565ColorPacking,
  584.     cmRGB565LSpace                = cmRGBSpace + cmWord565ColorPacking + cmLittleEndianPacking,
  585.     cmRGB24Space                = cmRGBSpace + cm24_8ColorPacking,
  586.     cmRGB32Space                = cmRGBSpace + cm32_8ColorPacking,
  587.     cmRGB48Space                = cmRGBSpace + cm48_16ColorPacking,
  588.     cmRGB48LSpace                = cmRGBSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  589.     cmARGB32Space                = cmRGBASpace + cm32_8ColorPacking + cmAlphaFirstPacking,
  590.     cmARGB64Space                = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking,
  591.     cmARGB64LSpace                = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking,
  592.     cmRGBA32Space                = cmRGBASpace + cm32_8ColorPacking + cmAlphaLastPacking,
  593.     cmRGBA64Space                = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking,
  594.     cmRGBA64LSpace                = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking,
  595.     cmCMYK32Space                = cmCMYKSpace + cm32_8ColorPacking,
  596.     cmCMYK64Space                = cmCMYKSpace + cm64_16ColorPacking,
  597.     cmCMYK64LSpace                = cmCMYKSpace + cm64_16ColorPacking + cmLittleEndianPacking,
  598.     cmHSV32Space                = cmHSVSpace + cmLong10ColorPacking,
  599.     cmHLS32Space                = cmHLSSpace + cmLong10ColorPacking,
  600.     cmYXY32Space                = cmYXYSpace + cmLong10ColorPacking,
  601.     cmXYZ24Space                = cmXYZSpace + cm24_8ColorPacking,
  602.     cmXYZ32Space                = cmXYZSpace + cmLong10ColorPacking,
  603.     cmXYZ48Space                = cmXYZSpace + cm48_16ColorPacking,
  604.     cmXYZ48LSpace                = cmXYZSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  605.     cmLUV32Space                = cmLUVSpace + cmLong10ColorPacking,
  606.     cmLAB24Space                = cmLABSpace + cm24_8ColorPacking,
  607.     cmLAB32Space                = cmLABSpace + cmLong10ColorPacking,
  608.     cmLAB48Space                = cmLABSpace + cm48_16ColorPacking,
  609.     cmLAB48LSpace                = cmLABSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  610.     cmGamutResult1Space            = cmOneBitDirectPacking + cmGamutResultSpace,
  611.     cmNamedIndexed32Space        = cm32_32ColorPacking + cmNamedIndexedSpace,
  612.     cmNamedIndexed32LSpace        = cm32_32ColorPacking + cmNamedIndexedSpace + cmLittleEndianPacking,
  613.     cmMCFive8Space                = cm40_8ColorPacking + cmMCFiveSpace,
  614.     cmMCSix8Space                = cm48_8ColorPacking + cmMCSixSpace,
  615.     cmMCSeven8Space                = cm56_8ColorPacking + cmMCSevenSpace,
  616.     cmMCEight8Space                = cm64_8ColorPacking + cmMCEightSpace
  617. };
  618.  
  619.  
  620.  
  621. typedef UInt32                             CMBitmapColorSpace;
  622.  
  623. struct CMBitmap {
  624.     char *                            image;
  625.     long                             width;
  626.     long                             height;
  627.     long                             rowBytes;
  628.     long                             pixelSize;
  629.     CMBitmapColorSpace                 space;
  630.     long                             user1;
  631.     long                             user2;
  632. };
  633. typedef struct CMBitmap                    CMBitmap;
  634.  
  635. /* Classic Print Manager Stuff */
  636. #if TARGET_OS_MAC
  637. enum {
  638.     enableColorMatchingOp        = 12,
  639.     registerProfileOp            = 13
  640. };
  641.  
  642. #endif  /* TARGET_OS_MAC */
  643.  
  644. /* Profile Locations */
  645. enum {
  646.     CS_MAX_PATH                    = 256
  647. };
  648.  
  649. enum {
  650.     cmNoProfileBase                = 0,
  651.     cmFileBasedProfile            = 1,
  652.     cmHandleBasedProfile        = 2,
  653.     cmPtrBasedProfile            = 3,
  654.     cmProcedureBasedProfile        = 4,
  655.     cmPathBasedProfile            = 5,
  656.     cmBufferBasedProfile        = 6
  657. };
  658.  
  659.  
  660. struct CMFileLocation {
  661.     FSSpec                             spec;
  662. };
  663. typedef struct CMFileLocation            CMFileLocation;
  664.  
  665. struct CMHandleLocation {
  666.     Handle                             h;
  667. };
  668. typedef struct CMHandleLocation            CMHandleLocation;
  669.  
  670. struct CMPtrLocation {
  671.     Ptr                             p;
  672. };
  673. typedef struct CMPtrLocation            CMPtrLocation;
  674.  
  675. struct CMProcedureLocation {
  676.     CMProfileAccessUPP                 proc;
  677.     void *                            refCon;
  678. };
  679. typedef struct CMProcedureLocation        CMProcedureLocation;
  680.  
  681. struct CMPathLocation {
  682.     char                             path[256];
  683. };
  684. typedef struct CMPathLocation            CMPathLocation;
  685.  
  686. struct CMBufferLocation {
  687.     void *                            buffer;
  688.     UInt32                             size;
  689. };
  690. typedef struct CMBufferLocation            CMBufferLocation;
  691.  
  692. union CMProfLoc {
  693.     CMFileLocation                     fileLoc;
  694.     CMHandleLocation                 handleLoc;
  695.     CMPtrLocation                     ptrLoc;
  696.     CMProcedureLocation             procLoc;
  697.     CMPathLocation                     pathLoc;
  698.     CMBufferLocation                 bufferLoc;
  699. };
  700. typedef union CMProfLoc                    CMProfLoc;
  701.  
  702. struct CMProfileLocation {
  703.     short                             locType;
  704.     CMProfLoc                         u;
  705. };
  706. typedef struct CMProfileLocation        CMProfileLocation;
  707. #if TARGET_OS_MAC
  708. enum {
  709.     cmOriginalProfileLocationSize = 72,
  710.     cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
  711. };
  712.  
  713. #else
  714. enum {
  715.     cmOriginalProfileLocationSize = 2 + CS_MAX_PATH,
  716.     cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
  717. };
  718.  
  719. #endif  /* TARGET_OS_MAC */
  720.  
  721. /* Struct and enums used for Profile iteration */
  722. enum {
  723.     cmProfileIterateDataVersion1 = 0x00010000,
  724.     cmProfileIterateDataVersion2 = 0x00020000
  725. };
  726.  
  727.  
  728. struct CMProfileIterateData {
  729.     UInt32                             dataVersion;                /* cmProfileIterateDataVersion2 */
  730.     CM2Header                         header;
  731.     ScriptCode                         code;
  732.     Str255                             name;
  733.     CMProfileLocation                 location;
  734.     UniCharCount                     uniCodeNameCount;
  735.     UniChar *                        uniCodeName;
  736.     unsigned char *                    asciiName;
  737.     CMMakeAndModel *                makeAndModel;
  738. };
  739. typedef struct CMProfileIterateData        CMProfileIterateData;
  740. /* Caller-supplied callback function for Profile & CMM iteration */
  741. typedef CALLBACK_API( OSErr , CMProfileIterateProcPtr )(CMProfileIterateData *iterateData, void *refCon);
  742. typedef CALLBACK_API( OSErr , CMMIterateProcPtr )(CMMInfo *iterateData, void *refCon);
  743. typedef STACK_UPP_TYPE(CMProfileIterateProcPtr)                 CMProfileIterateUPP;
  744. typedef STACK_UPP_TYPE(CMMIterateProcPtr)                         CMMIterateUPP;
  745. #if OPAQUE_UPP_TYPES
  746.     EXTERN_API(CMProfileIterateUPP)
  747.     NewCMProfileIterateUPP           (CMProfileIterateProcPtr    userRoutine);
  748.  
  749.     EXTERN_API(CMMIterateUPP)
  750.     NewCMMIterateUPP               (CMMIterateProcPtr        userRoutine);
  751.  
  752.     EXTERN_API(void)
  753.     DisposeCMProfileIterateUPP       (CMProfileIterateUPP        userUPP);
  754.  
  755.     EXTERN_API(void)
  756.     DisposeCMMIterateUPP           (CMMIterateUPP            userUPP);
  757.  
  758.     EXTERN_API(OSErr)
  759.     InvokeCMProfileIterateUPP       (CMProfileIterateData *    iterateData,
  760.                                     void *                    refCon,
  761.                                     CMProfileIterateUPP        userUPP);
  762.  
  763.     EXTERN_API(OSErr)
  764.     InvokeCMMIterateUPP               (CMMInfo *                iterateData,
  765.                                     void *                    refCon,
  766.                                     CMMIterateUPP            userUPP);
  767.  
  768. #else
  769.     enum { uppCMProfileIterateProcInfo = 0x000003E0 };                 /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  770.     enum { uppCMMIterateProcInfo = 0x000003E0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  771.     #define NewCMProfileIterateUPP(userRoutine)                     (CMProfileIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileIterateProcInfo, GetCurrentArchitecture())
  772.     #define NewCMMIterateUPP(userRoutine)                             (CMMIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMMIterateProcInfo, GetCurrentArchitecture())
  773.     #define DisposeCMProfileIterateUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  774.     #define DisposeCMMIterateUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  775.     #define InvokeCMProfileIterateUPP(iterateData, refCon, userUPP)  (OSErr)CALL_TWO_PARAMETER_UPP((userUPP), uppCMProfileIterateProcInfo, (iterateData), (refCon))
  776.     #define InvokeCMMIterateUPP(iterateData, refCon, userUPP)         (OSErr)CALL_TWO_PARAMETER_UPP((userUPP), uppCMMIterateProcInfo, (iterateData), (refCon))
  777. #endif
  778. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  779. #define NewCMProfileIterateProc(userRoutine)                     NewCMProfileIterateUPP(userRoutine)
  780. #define NewCMMIterateProc(userRoutine)                             NewCMMIterateUPP(userRoutine)
  781. #define CallCMProfileIterateProc(userRoutine, iterateData, refCon) InvokeCMProfileIterateUPP(iterateData, refCon, userRoutine)
  782. #define CallCMMIterateProc(userRoutine, iterateData, refCon)    InvokeCMMIterateUPP(iterateData, refCon, userRoutine)
  783. /* Profile file and element access */
  784. EXTERN_API( CMError )
  785. CMNewProfile                    (CMProfileRef *            prof,
  786.                                  const CMProfileLocation * theProfile)                        FOURWORDINLINE(0x203C, 0x0008, 0x001B, 0xABEE);
  787.  
  788. EXTERN_API( CMError )
  789. CMOpenProfile                    (CMProfileRef *            prof,
  790.                                  const CMProfileLocation * theProfile)                        FOURWORDINLINE(0x203C, 0x0008, 0x001C, 0xABEE);
  791.  
  792. EXTERN_API( CMError )
  793. CMCloseProfile                    (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x001D, 0xABEE);
  794.  
  795. EXTERN_API( CMError )
  796. CMUpdateProfile                    (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0034, 0xABEE);
  797.  
  798. EXTERN_API( CMError )
  799. CMCopyProfile                    (CMProfileRef *            targetProf,
  800.                                  const CMProfileLocation * targetLocation,
  801.                                  CMProfileRef             srcProf)                            FOURWORDINLINE(0x203C, 0x000C, 0x0025, 0xABEE);
  802.  
  803. EXTERN_API( CMError )
  804. CMValidateProfile                (CMProfileRef             prof,
  805.                                  Boolean *                valid,
  806.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x000C, 0x0026, 0xABEE);
  807.  
  808. EXTERN_API( CMError )
  809. CMGetProfileLocation            (CMProfileRef             prof,
  810.                                  CMProfileLocation *    theProfile)                            FOURWORDINLINE(0x203C, 0x0008, 0x003C, 0xABEE);
  811.  
  812. EXTERN_API( CMError )
  813. NCMGetProfileLocation            (CMProfileRef             prof,
  814.                                  CMProfileLocation *    theProfile,
  815.                                  UInt32 *                locationSize)                        FOURWORDINLINE(0x203C, 0x000C, 0x0059, 0xABEE);
  816.  
  817. EXTERN_API( CMError )
  818. CMFlattenProfile                (CMProfileRef             prof,
  819.                                  UInt32                 flags,
  820.                                  CMFlattenUPP             proc,
  821.                                  void *                    refCon,
  822.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x0031, 0xABEE);
  823.  
  824. #if TARGET_OS_MAC
  825. EXTERN_API( CMError )
  826. CMUnflattenProfile                (FSSpec *                resultFileSpec,
  827.                                  CMFlattenUPP             proc,
  828.                                  void *                    refCon,
  829.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x0032, 0xABEE);
  830.  
  831. #endif  /* TARGET_OS_MAC */
  832.  
  833. EXTERN_API( CMError )
  834. CMGetProfileHeader                (CMProfileRef             prof,
  835.                                  CMAppleProfileHeader *    header)                                FOURWORDINLINE(0x203C, 0x0008, 0x0039, 0xABEE);
  836.  
  837. EXTERN_API( CMError )
  838. CMSetProfileHeader                (CMProfileRef             prof,
  839.                                  const CMAppleProfileHeader * header)                        FOURWORDINLINE(0x203C, 0x0008, 0x003A, 0xABEE);
  840.  
  841. EXTERN_API( CMError )
  842. CMProfileElementExists            (CMProfileRef             prof,
  843.                                  OSType                 tag,
  844.                                  Boolean *                found)                                FOURWORDINLINE(0x203C, 0x000C, 0x001E, 0xABEE);
  845.  
  846. EXTERN_API( CMError )
  847. CMCountProfileElements            (CMProfileRef             prof,
  848.                                  UInt32 *                elementCount)                        FOURWORDINLINE(0x203C, 0x0008, 0x001F, 0xABEE);
  849.  
  850. EXTERN_API( CMError )
  851. CMGetProfileElement                (CMProfileRef             prof,
  852.                                  OSType                 tag,
  853.                                  UInt32 *                elementSize,
  854.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0020, 0xABEE);
  855.  
  856. EXTERN_API( CMError )
  857. CMSetProfileElement                (CMProfileRef             prof,
  858.                                  OSType                 tag,
  859.                                  UInt32                 elementSize,
  860.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0023, 0xABEE);
  861.  
  862. EXTERN_API( CMError )
  863. CMSetProfileElementSize            (CMProfileRef             prof,
  864.                                  OSType                 tag,
  865.                                  UInt32                 elementSize)                        FOURWORDINLINE(0x203C, 0x000C, 0x0038, 0xABEE);
  866.  
  867. EXTERN_API( CMError )
  868. CMSetProfileElementReference    (CMProfileRef             prof,
  869.                                  OSType                 elementTag,
  870.                                  OSType                 referenceTag)                        FOURWORDINLINE(0x203C, 0x000C, 0x0035, 0xABEE);
  871.  
  872. EXTERN_API( CMError )
  873. CMGetPartialProfileElement        (CMProfileRef             prof,
  874.                                  OSType                 tag,
  875.                                  UInt32                 offset,
  876.                                  UInt32 *                byteCount,
  877.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0014, 0x0036, 0xABEE);
  878.  
  879. EXTERN_API( CMError )
  880. CMSetPartialProfileElement        (CMProfileRef             prof,
  881.                                  OSType                 tag,
  882.                                  UInt32                 offset,
  883.                                  UInt32                 byteCount,
  884.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0014, 0x0037, 0xABEE);
  885.  
  886. EXTERN_API( CMError )
  887. CMGetIndProfileElementInfo        (CMProfileRef             prof,
  888.                                  UInt32                 index,
  889.                                  OSType *                tag,
  890.                                  UInt32 *                elementSize,
  891.                                  Boolean *                refs)                                FOURWORDINLINE(0x203C, 0x0014, 0x0021, 0xABEE);
  892.  
  893. EXTERN_API( CMError )
  894. CMGetIndProfileElement            (CMProfileRef             prof,
  895.                                  UInt32                 index,
  896.                                  UInt32 *                elementSize,
  897.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0022, 0xABEE);
  898.  
  899. EXTERN_API( CMError )
  900. CMRemoveProfileElement            (CMProfileRef             prof,
  901.                                  OSType                 tag)                                FOURWORDINLINE(0x203C, 0x0008, 0x0024, 0xABEE);
  902.  
  903. EXTERN_API( CMError )
  904. CMGetScriptProfileDescription    (CMProfileRef             prof,
  905.                                  Str255                 name,
  906.                                  ScriptCode *            code)                                FOURWORDINLINE(0x203C, 0x000C, 0x003E, 0xABEE);
  907.  
  908. EXTERN_API( CMError )
  909. CMGetProfileDescriptions        (CMProfileRef             prof,
  910.                                  char *                    aName,
  911.                                  UInt32 *                aCount,
  912.                                  Str255                 mName,
  913.                                  ScriptCode *            mCode,
  914.                                  UniChar *                uName,
  915.                                  UniCharCount *            uCount)                                FOURWORDINLINE(0x203C, 0x001A, 0x0067, 0xABEE);
  916.  
  917. EXTERN_API( CMError )
  918. CMSetProfileDescriptions        (CMProfileRef             prof,
  919.                                  const char *            aName,
  920.                                  UInt32                 aCount,
  921.                                  ConstStr255Param         mName,
  922.                                  ScriptCode             mCode,
  923.                                  const UniChar *        uName,
  924.                                  UniCharCount             uCount)                                FOURWORDINLINE(0x203C, 0x001A, 0x0068, 0xABEE);
  925.  
  926. EXTERN_API( CMError )
  927. CMCloneProfileRef                (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0042, 0xABEE);
  928.  
  929. EXTERN_API( CMError )
  930. CMGetProfileRefCount            (CMProfileRef             prof,
  931.                                  long *                    count)                                FOURWORDINLINE(0x203C, 0x0008, 0x0043, 0xABEE);
  932.  
  933. EXTERN_API( CMError )
  934. CMProfileModified                (CMProfileRef             prof,
  935.                                  Boolean *                modified)                            FOURWORDINLINE(0x203C, 0x0008, 0x0044, 0xABEE);
  936.  
  937.  
  938. /* named Color access functions */
  939. EXTERN_API( CMError )
  940. CMGetNamedColorInfo                (CMProfileRef             prof,
  941.                                  UInt32 *                deviceChannels,
  942.                                  OSType *                deviceColorSpace,
  943.                                  OSType *                PCSColorSpace,
  944.                                  UInt32 *                count,
  945.                                  StringPtr                 prefix,
  946.                                  StringPtr                 suffix)                                FOURWORDINLINE(0x203C, 0x001C, 0x0046, 0xABEE);
  947.  
  948. EXTERN_API( CMError )
  949. CMGetNamedColorValue            (CMProfileRef             prof,
  950.                                  StringPtr                 name,
  951.                                  CMColor *                deviceColor,
  952.                                  CMColor *                PCSColor)                            FOURWORDINLINE(0x203C, 0x0010, 0x0047, 0xABEE);
  953.  
  954. EXTERN_API( CMError )
  955. CMGetIndNamedColorValue            (CMProfileRef             prof,
  956.                                  UInt32                 index,
  957.                                  CMColor *                deviceColor,
  958.                                  CMColor *                PCSColor)                            FOURWORDINLINE(0x203C, 0x0010, 0x0048, 0xABEE);
  959.  
  960. EXTERN_API( CMError )
  961. CMGetNamedColorIndex            (CMProfileRef             prof,
  962.                                  StringPtr                 name,
  963.                                  UInt32 *                index)                                FOURWORDINLINE(0x203C, 0x000C, 0x0049, 0xABEE);
  964.  
  965. EXTERN_API( CMError )
  966. CMGetNamedColorName                (CMProfileRef             prof,
  967.                                  UInt32                 index,
  968.                                  StringPtr                 name)                                FOURWORDINLINE(0x203C, 0x000C, 0x004A, 0xABEE);
  969.  
  970.  
  971. /* General-purpose matching functions */
  972. EXTERN_API( CMError )
  973. NCWNewColorWorld                (CMWorldRef *            cw,
  974.                                  CMProfileRef             src,
  975.                                  CMProfileRef             dst)                                FOURWORDINLINE(0x203C, 0x000C, 0x0014, 0xABEE);
  976.  
  977. EXTERN_API( CMError )
  978. CWConcatColorWorld                (CMWorldRef *            cw,
  979.                                  CMConcatProfileSet *    profileSet)                            FOURWORDINLINE(0x203C, 0x0008, 0x0015, 0xABEE);
  980.  
  981. EXTERN_API( CMError )
  982. CWNewLinkProfile                (CMProfileRef *            prof,
  983.                                  const CMProfileLocation * targetLocation,
  984.                                  CMConcatProfileSet *    profileSet)                            FOURWORDINLINE(0x203C, 0x000C, 0x0033, 0xABEE);
  985.  
  986. EXTERN_API( CMError )
  987. NCWConcatColorWorld                (CMWorldRef *            cw,
  988.                                  NCMConcatProfileSet *    profileSet,
  989.                                  CMConcatCallBackUPP     proc,
  990.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x0008, 0x0061, 0xABEE);
  991.  
  992. EXTERN_API( CMError )
  993. NCWNewLinkProfile                (CMProfileRef *            prof,
  994.                                  const CMProfileLocation * targetLocation,
  995.                                  NCMConcatProfileSet *    profileSet,
  996.                                  CMConcatCallBackUPP     proc,
  997.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x000C, 0x0062, 0xABEE);
  998.  
  999. EXTERN_API( void )
  1000. CWDisposeColorWorld                (CMWorldRef             cw)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0001, 0xABEE);
  1001.  
  1002. EXTERN_API( CMError )
  1003. CWMatchColors                    (CMWorldRef             cw,
  1004.                                  CMColor *                myColors,
  1005.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0002, 0xABEE);
  1006.  
  1007. EXTERN_API( CMError )
  1008. CWCheckColors                    (CMWorldRef             cw,
  1009.                                  CMColor *                myColors,
  1010.                                  UInt32                 count,
  1011.                                  UInt32 *                result)                                FOURWORDINLINE(0x203C, 0x0010, 0x0003, 0xABEE);
  1012.  
  1013. EXTERN_API( CMError )
  1014. CWMatchBitmap                    (CMWorldRef             cw,
  1015.                                  CMBitmap *                bitmap,
  1016.                                  CMBitmapCallBackUPP     progressProc,
  1017.                                  void *                    refCon,
  1018.                                  CMBitmap *                matchedBitmap)                        FOURWORDINLINE(0x203C, 0x0010, 0x002C, 0xABEE);
  1019.  
  1020. EXTERN_API( CMError )
  1021. CWCheckBitmap                    (CMWorldRef             cw,
  1022.                                  const CMBitmap *        bitmap,
  1023.                                  CMBitmapCallBackUPP     progressProc,
  1024.                                  void *                    refCon,
  1025.                                  CMBitmap *                resultBitmap)                        FOURWORDINLINE(0x203C, 0x0014, 0x002D, 0xABEE);
  1026.  
  1027.  
  1028. /* Quickdraw-specific matching */
  1029. EXTERN_API( CMError )
  1030. CWMatchPixMap                    (CMWorldRef             cw,
  1031.                                  PixMap *                myPixMap,
  1032.                                  CMBitmapCallBackUPP     progressProc,
  1033.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x0010, 0x0004, 0xABEE);
  1034.  
  1035. EXTERN_API( CMError )
  1036. CWCheckPixMap                    (CMWorldRef             cw,
  1037.                                  PixMap *                myPixMap,
  1038.                                  CMBitmapCallBackUPP     progressProc,
  1039.                                  void *                    refCon,
  1040.                                  BitMap *                resultBitMap)                        FOURWORDINLINE(0x203C, 0x0014, 0x0007, 0xABEE);
  1041.  
  1042. #if TARGET_API_MAC_OS8 || TARGET_API_MAC_CARBON
  1043. EXTERN_API( CMError )
  1044. NCMBeginMatching                (CMProfileRef             src,
  1045.                                  CMProfileRef             dst,
  1046.                                  CMMatchRef *            myRef)                                FOURWORDINLINE(0x203C, 0x000C, 0x0016, 0xABEE);
  1047.  
  1048. EXTERN_API( void )
  1049. CMEndMatching                    (CMMatchRef             myRef)                                FOURWORDINLINE(0x203C, 0x0004, 0x000B, 0xABEE);
  1050.  
  1051. EXTERN_API( void )
  1052. NCMDrawMatchedPicture            (PicHandle                 myPicture,
  1053.                                  CMProfileRef             dst,
  1054.                                  Rect *                    myRect)                                FOURWORDINLINE(0x203C, 0x000C, 0x0017, 0xABEE);
  1055.  
  1056. EXTERN_API( void )
  1057. CMEnableMatchingComment            (Boolean                 enableIt)                            FOURWORDINLINE(0x203C, 0x0002, 0x000D, 0xABEE);
  1058.  
  1059. EXTERN_API( CMError )
  1060. NCMUseProfileComment            (CMProfileRef             prof,
  1061.                                  UInt32                 flags)                                FOURWORDINLINE(0x203C, 0x0008, 0x003B, 0xABEE);
  1062.  
  1063. #endif  /* TARGET_API_MAC_OS8 || TARGET_API_MAC_CARBON */
  1064.  
  1065. #if TARGET_OS_WIN32
  1066. EXTERN_API( CMError )
  1067. CWMatchHBITMAP                    (CMWorldRef             cw,
  1068.                                  HBITMAP                 hBitmap,
  1069.                                  CMBitmapCallBackUPP     progressProc,
  1070.                                  void *                    refCon);
  1071.  
  1072. #endif  /* TARGET_OS_WIN32 */
  1073.  
  1074. EXTERN_API( CMError )
  1075. CMCreateProfileIdentifier        (CMProfileRef             prof,
  1076.                                  CMProfileIdentifierPtr  ident,
  1077.                                  UInt32 *                size)                                FOURWORDINLINE(0x203C, 0x000C, 0x0041, 0xABEE);
  1078.  
  1079.  
  1080. /* System Profile access */
  1081. EXTERN_API( CMError )
  1082. CMGetSystemProfile                (CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0018, 0xABEE);
  1083.  
  1084. EXTERN_API( CMError )
  1085. CMSetSystemProfile                (const FSSpec *            profileFileSpec)                    FOURWORDINLINE(0x203C, 0x0004, 0x0019, 0xABEE);
  1086.  
  1087. EXTERN_API( CMError )
  1088. NCMSetSystemProfile                (const CMProfileLocation * profLoc)                            FOURWORDINLINE(0x203C, 0x0004, 0x0064, 0xABEE);
  1089.  
  1090. EXTERN_API( CMError )
  1091. CMGetDefaultProfileBySpace        (OSType                 dataColorSpace,
  1092.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x005A, 0xABEE);
  1093.  
  1094. EXTERN_API( CMError )
  1095. CMSetDefaultProfileBySpace        (OSType                 dataColorSpace,
  1096.                                  CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x005B, 0xABEE);
  1097.  
  1098. #if TARGET_OS_MAC
  1099. EXTERN_API( CMError )
  1100. CMGetProfileByAVID                (AVIDType                 theAVID,
  1101.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x005C, 0xABEE);
  1102.  
  1103. EXTERN_API( CMError )
  1104. CMSetProfileByAVID                (AVIDType                 theAVID,
  1105.                                  CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x005D, 0xABEE);
  1106.  
  1107. #endif  /* TARGET_OS_MAC */
  1108.  
  1109. /* Profile Use enumerations */
  1110. enum {
  1111.     cmInputUse                    = FOUR_CHAR_CODE('inpt'),
  1112.     cmOutputUse                    = FOUR_CHAR_CODE('outp'),
  1113.     cmDisplayUse                = FOUR_CHAR_CODE('dply'),
  1114.     cmProofUse                    = FOUR_CHAR_CODE('pruf')
  1115. };
  1116.  
  1117. /* Profile access by Use */
  1118. EXTERN_API( CMError )
  1119. CMGetDefaultProfileByUse        (OSType                 use,
  1120.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x0069, 0xABEE);
  1121.  
  1122. EXTERN_API( CMError )
  1123. CMSetDefaultProfileByUse        (OSType                 use,
  1124.                                  CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0008, 0x0079, 0xABEE);
  1125.  
  1126. /* Profile Management */
  1127. EXTERN_API( CMError )
  1128. CMNewProfileSearch                (CMSearchRecord *        searchSpec,
  1129.                                  void *                    refCon,
  1130.                                  UInt32 *                count,
  1131.                                  CMProfileSearchRef *    searchResult)                        FOURWORDINLINE(0x203C, 0x0010, 0x0027, 0xABEE);
  1132.  
  1133. EXTERN_API( CMError )
  1134. CMUpdateProfileSearch            (CMProfileSearchRef     search,
  1135.                                  void *                    refCon,
  1136.                                  UInt32 *                count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0028, 0xABEE);
  1137.  
  1138. EXTERN_API( void )
  1139. CMDisposeProfileSearch            (CMProfileSearchRef     search)                                FOURWORDINLINE(0x203C, 0x0004, 0x0029, 0xABEE);
  1140.  
  1141. EXTERN_API( CMError )
  1142. CMSearchGetIndProfile            (CMProfileSearchRef     search,
  1143.                                  UInt32                 index,
  1144.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x000C, 0x002A, 0xABEE);
  1145.  
  1146. EXTERN_API( CMError )
  1147. CMSearchGetIndProfileFileSpec    (CMProfileSearchRef     search,
  1148.                                  UInt32                 index,
  1149.                                  FSSpec *                profileFile)                        FOURWORDINLINE(0x203C, 0x000C, 0x002B, 0xABEE);
  1150.  
  1151. EXTERN_API( CMError )
  1152. CMProfileIdentifierFolderSearch    (CMProfileIdentifierPtr  ident,
  1153.                                  UInt32 *                matchedCount,
  1154.                                  CMProfileSearchRef *    searchResult)                        FOURWORDINLINE(0x203C, 0x000C, 0x003F, 0xABEE);
  1155.  
  1156. EXTERN_API( CMError )
  1157. CMProfileIdentifierListSearch    (CMProfileIdentifierPtr  ident,
  1158.                                  CMProfileRef *            profileList,
  1159.                                  UInt32                 listSize,
  1160.                                  UInt32 *                matchedCount,
  1161.                                  CMProfileRef *            matchedList)                        FOURWORDINLINE(0x203C, 0x0014, 0x0040, 0xABEE);
  1162.  
  1163. EXTERN_API( CMError )
  1164. CMIterateColorSyncFolder        (CMProfileIterateUPP     proc,
  1165.                                  UInt32 *                seed,
  1166.                                  UInt32 *                count,
  1167.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x0010, 0x0058, 0xABEE);
  1168.  
  1169. EXTERN_API( CMError )
  1170. NCMUnflattenProfile                (CMProfileLocation *    targetLocation,
  1171.                                  CMFlattenUPP             proc,
  1172.                                  void *                    refCon,
  1173.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x0065, 0xABEE);
  1174.  
  1175. /* Utilities */
  1176. #if TARGET_OS_MAC
  1177. EXTERN_API( CMError )
  1178. CMGetColorSyncFolderSpec        (short                     vRefNum,
  1179.                                  Boolean                 createFolder,
  1180.                                  short *                foundVRefNum,
  1181.                                  long *                    foundDirID)                            FOURWORDINLINE(0x203C, 0x000C, 0x0011, 0xABEE);
  1182.  
  1183. #endif  /* TARGET_OS_MAC */
  1184.  
  1185. #if TARGET_OS_WIN32 || TARGET_OS_UNIX
  1186. EXTERN_API( CMError )
  1187. CMGetColorSyncFolderPath        (Boolean                 createFolder,
  1188.                                  char *                    lpBuffer,
  1189.                                  UInt32                 uSize);
  1190.  
  1191. #endif  /* TARGET_OS_WIN32 || TARGET_OS_UNIX */
  1192.  
  1193. EXTERN_API( CMError )
  1194. CMGetCWInfo                        (CMWorldRef             cw,
  1195.                                  CMCWInfoRecord *        info)                                FOURWORDINLINE(0x203C, 0x0008, 0x001A, 0xABEE);
  1196.  
  1197. #if TARGET_API_MAC_OS8
  1198. EXTERN_API( CMError )
  1199. CMConvertProfile2to1            (CMProfileRef             profv2,
  1200.                                  CMProfileHandle *        profv1)                                FOURWORDINLINE(0x203C, 0x0008, 0x0045, 0xABEE);
  1201.  
  1202. #endif  /* TARGET_API_MAC_OS8 */
  1203.  
  1204. EXTERN_API( CMError )
  1205. CMGetPreferredCMM                (OSType *                cmmType,
  1206.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0008, 0x005E, 0xABEE);
  1207.  
  1208. EXTERN_API( CMError )
  1209. CMIterateCMMInfo                (CMMIterateUPP             proc,
  1210.                                  UInt32 *                count,
  1211.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x000C, 0x0063, 0xABEE);
  1212.  
  1213. EXTERN_API( CMError )
  1214. CMGetColorSyncVersion            (UInt32 *                version)                            FOURWORDINLINE(0x203C, 0x0004, 0x0066, 0xABEE);
  1215.  
  1216. EXTERN_API( CMError )
  1217. CMLaunchControlPanel            (UInt32                 flags);
  1218.  
  1219. /* ColorSpace conversion functions */
  1220. EXTERN_API( CMError )
  1221. CMConvertXYZToLab                (const CMColor *        src,
  1222.                                  const CMXYZColor *        white,
  1223.                                  CMColor *                dst,
  1224.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004B, 0xABEE);
  1225.  
  1226. EXTERN_API( CMError )
  1227. CMConvertLabToXYZ                (const CMColor *        src,
  1228.                                  const CMXYZColor *        white,
  1229.                                  CMColor *                dst,
  1230.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004C, 0xABEE);
  1231.  
  1232. EXTERN_API( CMError )
  1233. CMConvertXYZToLuv                (const CMColor *        src,
  1234.                                  const CMXYZColor *        white,
  1235.                                  CMColor *                dst,
  1236.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004D, 0xABEE);
  1237.  
  1238. EXTERN_API( CMError )
  1239. CMConvertLuvToXYZ                (const CMColor *        src,
  1240.                                  const CMXYZColor *        white,
  1241.                                  CMColor *                dst,
  1242.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004E, 0xABEE);
  1243.  
  1244. EXTERN_API( CMError )
  1245. CMConvertXYZToYxy                (const CMColor *        src,
  1246.                                  CMColor *                dst,
  1247.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x004F, 0xABEE);
  1248.  
  1249. EXTERN_API( CMError )
  1250. CMConvertYxyToXYZ                (const CMColor *        src,
  1251.                                  CMColor *                dst,
  1252.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0050, 0xABEE);
  1253.  
  1254. EXTERN_API( CMError )
  1255. CMConvertRGBToHLS                (const CMColor *        src,
  1256.                                  CMColor *                dst,
  1257.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0051, 0xABEE);
  1258.  
  1259. EXTERN_API( CMError )
  1260. CMConvertHLSToRGB                (const CMColor *        src,
  1261.                                  CMColor *                dst,
  1262.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0052, 0xABEE);
  1263.  
  1264. EXTERN_API( CMError )
  1265. CMConvertRGBToHSV                (const CMColor *        src,
  1266.                                  CMColor *                dst,
  1267.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0053, 0xABEE);
  1268.  
  1269. EXTERN_API( CMError )
  1270. CMConvertHSVToRGB                (const CMColor *        src,
  1271.                                  CMColor *                dst,
  1272.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0054, 0xABEE);
  1273.  
  1274. EXTERN_API( CMError )
  1275. CMConvertRGBToGray                (const CMColor *        src,
  1276.                                  CMColor *                dst,
  1277.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0055, 0xABEE);
  1278.  
  1279. EXTERN_API( CMError )
  1280. CMConvertXYZToFixedXYZ            (const CMXYZColor *        src,
  1281.                                  CMFixedXYZColor *        dst,
  1282.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0056, 0xABEE);
  1283.  
  1284. EXTERN_API( CMError )
  1285. CMConvertFixedXYZToXYZ            (const CMFixedXYZColor * src,
  1286.                                  CMXYZColor *            dst,
  1287.                                  UInt32                 count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0057, 0xABEE);
  1288.  
  1289.  
  1290. /* PS-related */
  1291. EXTERN_API( CMError )
  1292. CMGetPS2ColorSpace                (CMProfileRef             srcProf,
  1293.                                  UInt32                 flags,
  1294.                                  CMFlattenUPP             proc,
  1295.                                  void *                    refCon,
  1296.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x002E, 0xABEE);
  1297.  
  1298. EXTERN_API( CMError )
  1299. CMGetPS2ColorRenderingIntent    (CMProfileRef             srcProf,
  1300.                                  UInt32                 flags,
  1301.                                  CMFlattenUPP             proc,
  1302.                                  void *                    refCon,
  1303.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x002F, 0xABEE);
  1304.  
  1305. EXTERN_API( CMError )
  1306. CMGetPS2ColorRendering            (CMProfileRef             srcProf,
  1307.                                  CMProfileRef             dstProf,
  1308.                                  UInt32                 flags,
  1309.                                  CMFlattenUPP             proc,
  1310.                                  void *                    refCon,
  1311.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0018, 0x0030, 0xABEE);
  1312.  
  1313. EXTERN_API( CMError )
  1314. CMGetPS2ColorRenderingVMSize    (CMProfileRef             srcProf,
  1315.                                  CMProfileRef             dstProf,
  1316.                                  UInt32 *                vmSize,
  1317.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x003D, 0xABEE);
  1318.  
  1319.  
  1320. /* ColorSync 1.0 functions which have parallel 2.0 counterparts */
  1321. #if TARGET_API_MAC_OS8
  1322. EXTERN_API( CMError )
  1323. CWNewColorWorld                    (CMWorldRef *            cw,
  1324.                                  CMProfileHandle         src,
  1325.                                  CMProfileHandle         dst)                                FOURWORDINLINE(0x203C, 0x000C, 0x0000, 0xABEE);
  1326.  
  1327. EXTERN_API( CMError )
  1328. ConcatenateProfiles                (CMProfileHandle         thru,
  1329.                                  CMProfileHandle         dst,
  1330.                                  CMProfileHandle *        newDst)                                FOURWORDINLINE(0x203C, 0x000C, 0x000C, 0xABEE);
  1331.  
  1332. EXTERN_API( CMError )
  1333. CMBeginMatching                    (CMProfileHandle         src,
  1334.                                  CMProfileHandle         dst,
  1335.                                  CMMatchRef *            myRef)                                FOURWORDINLINE(0x203C, 0x000C, 0x000A, 0xABEE);
  1336.  
  1337. EXTERN_API( void )
  1338. CMDrawMatchedPicture            (PicHandle                 myPicture,
  1339.                                  CMProfileHandle         dst,
  1340.                                  Rect *                    myRect)                                FOURWORDINLINE(0x203C, 0x000C, 0x0009, 0xABEE);
  1341.  
  1342. EXTERN_API( CMError )
  1343. CMUseProfileComment                (CMProfileHandle         profile)                            FOURWORDINLINE(0x203C, 0x0004, 0x0008, 0xABEE);
  1344.  
  1345. EXTERN_API( void )
  1346. CMGetProfileName                (CMProfileHandle         myProfile,
  1347.                                  CMIString *            IStringResult)                        FOURWORDINLINE(0x203C, 0x0008, 0x000E, 0xABEE);
  1348.  
  1349. EXTERN_API( long )
  1350. CMGetProfileAdditionalDataOffset (CMProfileHandle         myProfile)                            FOURWORDINLINE(0x203C, 0x0004, 0x000F, 0xABEE);
  1351.  
  1352.  
  1353. /* ProfileResponder functions */
  1354. EXTERN_API( CMError )
  1355. GetProfile                        (OSType                 deviceType,
  1356.                                  long                     refNum,
  1357.                                  CMProfileHandle         aProfile,
  1358.                                  CMProfileHandle *        returnedProfile)                    FOURWORDINLINE(0x203C, 0x0010, 0x0005, 0xABEE);
  1359.  
  1360. EXTERN_API( CMError )
  1361. SetProfile                        (OSType                 deviceType,
  1362.                                  long                     refNum,
  1363.                                  CMProfileHandle         newProfile)                            FOURWORDINLINE(0x203C, 0x000C, 0x0006, 0xABEE);
  1364.  
  1365. EXTERN_API( CMError )
  1366. SetProfileDescription            (OSType                 deviceType,
  1367.                                  long                     refNum,
  1368.                                  long                     deviceData,
  1369.                                  CMProfileHandle         hProfile)                            FOURWORDINLINE(0x203C, 0x0010, 0x0010, 0xABEE);
  1370.  
  1371. EXTERN_API( CMError )
  1372. GetIndexedProfile                (OSType                 deviceType,
  1373.                                  long                     refNum,
  1374.                                  CMProfileSearchRecordHandle  search,
  1375.                                  CMProfileHandle *        returnProfile,
  1376.                                  long *                    index)                                FOURWORDINLINE(0x203C, 0x0014, 0x0012, 0xABEE);
  1377.  
  1378. EXTERN_API( CMError )
  1379. DeleteDeviceProfile                (OSType                 deviceType,
  1380.                                  long                     refNum,
  1381.                                  CMProfileHandle         deleteMe)                            FOURWORDINLINE(0x203C, 0x000C, 0x0013, 0xABEE);
  1382.  
  1383.  
  1384. #if OLDROUTINENAMES
  1385. /* constants */
  1386.  
  1387. typedef CMFlattenProcPtr                 CMFlattenProc;
  1388. typedef CMBitmapCallBackProcPtr         CMBitmapCallBackProc;
  1389. typedef CMProfileFilterProcPtr             CMProfileFilterProc;
  1390. enum {
  1391.     CMTrap                        = cmTrap,
  1392.     CMBeginProfile                = cmBeginProfile,
  1393.     CMEndProfile                = cmEndProfile,
  1394.     CMEnableMatching            = cmEnableMatching,
  1395.     CMDisableMatching            = cmDisableMatching
  1396. };
  1397.  
  1398. /* 1.0 Error codes, for compatibility with older applications. 1.0 CMM's may return obsolete error codes */
  1399. enum {
  1400.     CMNoError                    = 0,                            /*    obsolete name, use noErr */
  1401.     CMProfileError                = cmProfileError,
  1402.     CMMethodError                = cmMethodError,
  1403.     CMMemFullError                = -172,                            /*    obsolete, 2.0 uses memFullErr */
  1404.     CMUnimplementedError        = -173,                            /*    obsolete, 2.0 uses unimpErr */
  1405.     CMParamError                = -174,                            /*    obsolete, 2.0 uses paramErr */
  1406.     CMMethodNotFound            = cmMethodNotFound,
  1407.     CMProfileNotFound            = cmProfileNotFound,
  1408.     CMProfilesIdentical            = cmProfilesIdentical,
  1409.     CMCantConcatenateError        = cmCantConcatenateError,
  1410.     CMCantXYZ                    = cmCantXYZ,
  1411.     CMCantDeleteProfile            = cmCantDeleteProfile,
  1412.     CMUnsupportedDataType        = cmUnsupportedDataType,
  1413.     CMNoCurrentProfile            = cmNoCurrentProfile
  1414. };
  1415.  
  1416. enum {
  1417.     qdSystemDevice                = cmSystemDevice,
  1418.     qdGDevice                    = cmGDevice
  1419. };
  1420.  
  1421.  
  1422. enum {
  1423.     kMatchCMMType                = cmMatchCMMType,
  1424.     kMatchApplProfileVersion    = cmMatchApplProfileVersion,
  1425.     kMatchDataType                = cmMatchDataType,
  1426.     kMatchDeviceType            = cmMatchDeviceType,
  1427.     kMatchDeviceManufacturer    = cmMatchDeviceManufacturer,
  1428.     kMatchDeviceModel            = cmMatchDeviceModel,
  1429.     kMatchDeviceAttributes        = cmMatchDeviceAttributes,
  1430.     kMatchFlags                    = cmMatchFlags,
  1431.     kMatchOptions                = cmMatchOptions,
  1432.     kMatchWhite                    = cmMatchWhite,
  1433.     kMatchBlack                    = cmMatchBlack
  1434. };
  1435.  
  1436. /* types */
  1437. typedef CMCMYKColor                     CMYKColor;
  1438. typedef CMWorldRef                         CWorld;
  1439. typedef long *                            CMGamutResult;
  1440. /* functions */
  1441. #define EndMatching(myRef)                                                        CMEndMatching(myRef)
  1442. #define EnableMatching(enableIt)                                                CMEnableMatchingComment(enableIt)
  1443. #define GetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)    CMGetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)
  1444. #define BeginMatching(src, dst, myRef)                                            CMBeginMatching(src, dst, myRef)
  1445. #define DrawMatchedPicture(myPicture, dst, myRect)                                CMDrawMatchedPicture(myPicture, dst, myRect)
  1446. #define UseProfile(profile)                                                        CMUseProfileComment(profile)
  1447. #define GetProfileName(myProfile, IStringResult)                                CMGetProfileName(myProfile, IStringResult)
  1448. #define GetProfileAdditionalDataOffset(myProfile)                                CMGetProfileAdditionalDataOffset(myProfile)
  1449. #endif  /* OLDROUTINENAMES */
  1450.  
  1451. /* Deprecated stuff*/
  1452.  
  1453. /* PrGeneral parameter blocks */
  1454.  
  1455. struct TEnableColorMatchingBlk {
  1456.     short                             iOpCode;
  1457.     short                             iError;
  1458.     long                             lReserved;
  1459.     THPrint                         hPrint;
  1460.     Boolean                         fEnableIt;
  1461.     SInt8                             filler;
  1462. };
  1463. typedef struct TEnableColorMatchingBlk    TEnableColorMatchingBlk;
  1464.  
  1465. struct TRegisterProfileBlk {
  1466.     short                             iOpCode;
  1467.     short                             iError;
  1468.     long                             lReserved;
  1469.     THPrint                         hPrint;
  1470.     Boolean                         fRegisterIt;
  1471.     SInt8                             filler;
  1472. };
  1473. typedef struct TRegisterProfileBlk        TRegisterProfileBlk;
  1474. #endif  /* TARGET_API_MAC_OS8 */
  1475.  
  1476.  
  1477. #if PRAGMA_STRUCT_ALIGN
  1478.     #pragma options align=reset
  1479. #elif PRAGMA_STRUCT_PACKPUSH
  1480.     #pragma pack(pop)
  1481. #elif PRAGMA_STRUCT_PACK
  1482.     #pragma pack()
  1483. #endif
  1484.  
  1485. #ifdef PRAGMA_IMPORT_OFF
  1486. #pragma import off
  1487. #elif PRAGMA_IMPORT
  1488. #pragma import reset
  1489. #endif
  1490.  
  1491. #ifdef __cplusplus
  1492. }
  1493. #endif
  1494.  
  1495. #endif /* __CMAPPLICATION__ */
  1496.  
  1497.